$(function () {

    var defeated = JSON.parse(localStorage.getItem('defeated'));
    if (defeated == 0) {
        location.href = './login.html';
    }
    $('#logout').click(function () {
        $.ajax({
            type: 'get',
            url: '/user/logout',
            dataType: 'json',
            success: function (res) {
                console.log(res);
                location.href = './login.html';
            }
        })
    })
})